package com.stox.client.embedded.watchlist;

import java.util.List;

import com.stox.client.api.watchlist.WatchlistEntryClient;
import com.stox.services.watchlist.manager.WatchlistEntryManager;
import com.stox.shared.core.util.DebugUtil;
import com.stox.shared.watchlist.model.WatchlistEntry;

public class EmbeddedWatchlistEntryClient implements WatchlistEntryClient {
	
	public static final EmbeddedWatchlistEntryClient INSTANCE = new EmbeddedWatchlistEntryClient();
	
	private EmbeddedWatchlistEntryClient() {
		
	}
	
	@Override
	public List<WatchlistEntry> findByWatchlistId(Long watchlistId) {
		DebugUtil.printStack();
		return WatchlistEntryManager.INSTANCE.findByWatchlistId(watchlistId);
	}

	@Override
	public Long saveOrUpdate(WatchlistEntry watchlistEntry) {
		DebugUtil.printStack();
		Long id = WatchlistEntryManager.INSTANCE.saveOrUpdate(watchlistEntry);
		watchlistEntry.setId(id);
		return id;
	}

	@Override
	public void delete(Long id) {
		DebugUtil.printStack();
		WatchlistEntryManager.INSTANCE.delete(id);
	}

}
